<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<s:head />
<style type="text/css">
@import url(media/css/style.css);
</style>
</head>
<body>
<s:form action="addQuestionToExamination">
<s:if test="listQuestionEntity.size() > 0">
	<div class="content">
	<table class="userTable" cellpadding="5px">
		<tr class="even">
			<th><input type="checkbox" id="allId" onclick="checkAll(this.id)"/></th>
			<th>Nội dung</th>
			<th>Loại câu hỏi</th>
			<th>Điểm câu hỏi</th>
			<th>Thời gian</th>
			<th>Số đáp án đúng</th>
			<th>Chủ đề</th>
			<th>Chia sẽ</th>
			<th>Ngày tạo</th>
			<th>Ngày cập nhật</th>
			<th>Hành động</th>
		</tr>
		<s:iterator value="listQuestionEntity" status="userStatus">
			<tr
				class="<s:if test="#userStatus.odd == true ">odd</s:if><s:else>even</s:else>">
				<td>
					<input type="checkbox" name="arrayQuestId" value='<s:property value="questionId"/>' onclick="checkBox(this.name)">
				</td>
				<td><s:property value="questionContent" /></td>
				<td>
					<s:if test="questionType == 1">
						Nhiều đáp án đúng
					</s:if>
					<s:else>
						Một đáp án đúng
					</s:else>
				</td>
				<td><s:property value="questionMark" /></td>
				<td><s:property value="questionTime" /></td>
				<td><s:property value="correctNum" /></td>
				<td><s:property value="subQuestionEntity.subject" /></td>
				<td>
					<s:if test="published == 1">
						Chia sẽ
					</s:if>
					<s:else>
						Không chia sẽ
					</s:else>
				</td>
				<td><s:date name="createDate" format="dd/MM/yyyy HH:mm:ss" /></td>
				<td><s:date name="updateDate" format="dd/MM/yyyy HH:mm:ss" /></td>
				<td colspan="3">
					<s:url id="viewURL" action="viewQuestion">
						<s:param name="questionId" value="%{questionId}"></s:param>
					</s:url> <s:a href="%{viewURL}">View</s:a> | 
					<s:url id="editURL" action="editQuestion">
						<s:param name="questionId" value="%{questionId}"></s:param>
					</s:url> <s:a href="%{editURL}">Edit</s:a> |
					<s:url id="deleteURL" action="deleteQuestion">
						<s:param name="questionId" value="%{questionId}"></s:param>
					</s:url> <s:a href="%{deleteURL}">Delete</s:a></td>
			</tr>
		</s:iterator>
	</table>
	</div>
</s:if>
	<s:hidden name="examId" value="%{examId}" />
	<s:submit name="add_quest_to_exam" value="Add Question To Examination" />
	<s:submit name="button_save" value="Save" />
</s:form>
<s:a href="index.jsp">Home</s:a>
</body>
</html>